
package ch.hearc.coursJava.kitBase.de.wrapperPerso;

import java.util.Set;
import java.util.TreeSet;

import ch.hearc.coursJava.kitBase.tools.AleaTools;

public class UseLancerAleatoireSetWrapperPerso
	{

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	public static void main(String[] args)
		{
		main();
		}

	public static void main()
		{
		int nbFaces = 6;
		int nbLancerTotal = 0;
		int nbPasses = 1000000;
		Set<Integers> setValeurs = new TreeSet<Integers>();

		for(int i = 0; i < nbPasses; i++)
			{
			setValeurs.clear();

			while(setValeurs.size() < nbFaces)
				{
				int val = AleaTools.lancer(nbFaces);
				Integers integers = new Integers(val);
				setValeurs.add(integers);
				nbLancerTotal++;
				}
			}

		int nbLancerMoyenArrondi = (int)Math.ceil(nbLancerTotal / (double)nbPasses);

		System.out.println("Nombre de lancer moyen: " + nbLancerMoyenArrondi);
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	}
